#ifndef _CONFIG_H
#define _CONFIG_H

#include "render.h"
#include <wx/textctrl.h>
#include <wx/font.h>
#include <wx/string.h>
#include <wx/colour.h>
class wxFileConfig;

enum FONTS
{
    FONT_DEFAULT=0,
    FONT_CAPTION,
    FONT_DATE,
    FONT_ERROR,
    FONT_KEYWORD,
    FONT_KEYWORD_MARK,
    FONT_UNK_KEYWORD,
    FONT_SOURCE,
    FONT_MAX
};

class Config
{
    private:
        wxString config_file_name;

    public:
        wxString lang; // can be L"" if unknown
        int scroll_speed;
        RenderOptions render_options;
        struct FontEntry {
            wxString name;
            wxTextAttr attr;
        } fonts[FONT_MAX];

        Config(const wxString& config_file_name);
        void ResetDefaults();
        bool GetLangDesc(const wxString& lang, wxLanguageInfo *langinfo) const;
        bool CheckLangString(const wxString& lang) const;
        void LoadLang();
        bool Load();
        void Save();
};

extern Config* config;

#endif
